<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c"       uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>" />
     <meta http-equiv="content-Type" content="text/html; charset=utf-8" />
    <title>tueye发表文章-tueye发表文章-就爱看图网</title>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="发表图片文章,图文并茂" />
	<meta http-equiv="description" content="发表图片文章入口" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	  <link href="<%=path %>/script/jLook/templates/default/default.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/themes/css/index.css" rel="stylesheet" type="text/css" />
 	 
   <script type="text/javascript" src="<%=path %>/script/jquery.js"></script>
   <script type="text/javascript" src="<%=path %>/script/jLook/jLook-latest.js"></script>
 
   <style type="text/css">
   #publishtable{
    font-size:12px;
   }
   .redColor{
    color:#cccc;
    margin:10px;
   }
   #mainbody,#tip{
    text-align:left;
   }
  #tip{
     overflow:hidden;
     width:500px;
     height:75px;
     border:1px dotted #FF5131;
     background-color:#FFFFE5; 
     padding:4px;
     color:#958895;
  }
   #mainbody h1{
    border-bottom:2px solid #FF5131;
    font-size:16px;
    clear:both;
   }
   #guan{
   position:relative; 
	 top:0px; 
	 right:-480px; 
      display: inline;
     
   }
 
   .addit{
       width:80px;
       height:30px;
       border:1px solid #958895;
       background-color:white;
       font-size:14px;
       
        color:#cccc;
       CURSOR: hand;
   }
   .addit_over{
       width:80px;
       height:30px;
       border:1px solid white;
       background-color:#6666CC;
       font-weight:bold;
       color:#FFFFFF;
       CURSOR: hand;
   }
   </style>
   <script type="text/javascript">
    var ifsubmit = false;
    var num = 0;
	 $(document).ready(function(){
		 $("#publsihtopic").jLook({selectHeight: '120'});
		 
		 
	     $("#tijiao").hover(
	       function() { 
              $(this).addClass("addit_over"); 
            },
           function() { 
            $(this).removeClass("addit_over");
              
            });
            
      
            
		 $("input").blur(
		 function(){
		   
		   var id = $(this).attr("id");
		   if(id == 'topic_title'){
		     if($(this).attr("value") == null || $(this).attr("value") == '')
		     {  
		        ifsubmit = false;
		       $(this).parent().parent().next().html("<font color='red'>文章标题不能为空</font>"); 
		     }
		     else{ 
		        ifsubmit = true;
		        $(this).parent().parent().next().html("");
		      }
		   }
		    if(id == 'topic_overview'){
		     if($(this).attr("value") == null || $(this).attr("value") == '')
		     {  
		     ifsubmit = false;
		       $(this).parent().parent().next().html("<font color='red'>文章概述不能为空</font>"); 
		     }
		     else{ 
		       ifsubmit = true;
		        $(this).parent().parent().next().html("");
		      }
		 
		    } 
		   
		    if(id == 'radio3'){
               alert($('input[@name=publi][@checked]').val());
		 
		    }
            if(id == 'topic_code'){
		     if($(this).attr("value") == null || $(this).attr("value") == '')
		     {  
		        ifsubmit = false;
		       $(this).parent().parent().next().next().html("<font color='red'>&nbsp;&nbsp;&nbsp;&nbsp;验证码不能为空</font>"); 
		     }
		     else{ 
		        ifsubmit = true;
		        $(this).parent().parent().next().next().html("");
		      }
		 
		    } 
		   }
		 );
		 
		  
		  
		 } 
		 );
		 
		 function checkform(){  
		   if(ifsubmit=true){
		      if($('#topic_type').val()==0){
		      $('#topic_type').parent().parent().next().html("<font color='red'>请选择文章类型</font>"); 
		      return false;
		   }else{
		   $('#topic_type').parent().parent().next().html("");
		   return true;
		   }
		   }else{
		 	return false;
		 	 }
		 	
		 }
		function refrash(){
		$('#imgId')[0].src+='?'+Math.floor(Math.random()*10);
		}
  </script>
  </head>
  <body><%@ include file="../../../../common/header.jsp" %>
<div id="container">

<div id="mainbody">
<h1>图片文章基本信息上传</h1>
<div id="tip"><div id="guan"><img src="<%=path %>/themes/images/13.gif" onClick='javascript:$("#tip").hide(280);' /></div> 
<pre style="display: inline;line-height:18px;">
提示:1.标题前加*的为必填项
       2. 文章作者不填写默写了发布者妮称．
</pre> 
</div>
        <form method="post" name="publsihtopic" id="publsihtopic" action="publish_process.do" onsubmit="return checkform();" >
            	<table width="600px" border="0" id="publishtable" cellspacing="0" cellpadding="2">
		<tr>
			<td><label for="topic_title" class="redColor"><font color="red">*&nbsp;</font>文章标题 </label></td>
			<td><input type="text" name="topic_title" id="topic_title" style="width: 250px;" value="${topic_title }" /></td>
			<td align="left"></td>
		</tr>
		<tr>
			<td><label for="topic_overview" class="redColor"><font color="red">*&nbsp;</font>文章概述 </label></td>
			<td>
			<!-- <input type="text"   name="topic_overview" id="topic_overview"  value="${topic_overview }"  style="width: 300px;"  ></input> -->
			<textarea rows="6" cols="30" name="topic_overview" id="topic_overview"  >${topic_overview }</textarea>
			</td>
		  <td></td>
		<tr>　
		<tr>
          <td><label for="topic_type" class="redColor"><font color="red">*&nbsp;</font>文章类别 </label></td>
		  <td><select name="topic_type" id="topic_type">
              <option value="0">--请选择--</option>
                      <c:forEach var="type" items="${types}">
                          <option value="${type.id}">${type.type_name }</option>
                     </c:forEach>
            </select>
          </td>
          <td></td>
	    </tr>
		<tr>
			<td><label for="topic_author" class="redColor">&nbsp;&nbsp;文章作者</label></td>
			<td><input type="text"   name="topic_author" id="topic_author"  value="${topic_author }"  /></td>
			<td></td>
		</tr>
		<tr>
			<td><label for="topic_from" class="redColor">&nbsp;&nbsp;文章转自</label></td>
			<td><input type="text"   name="topic_from" id="topic_from"   style="width: 250px;" value="${topic_from }" /></td>
			<td></td>
		</tr>
		 <tr>
			<td><label for="topic_code" class="redColor"><font color="red">*&nbsp;</font>验证码</label></td>
			<td>
			 <table  border="0" cellspacing="0" cellpadding="2">
			 <tr>
			 <td><input type="text"   name="topic_code" id="topic_code"   style="width: 60px;"  /></td>
			 <td><img  id ='imgId' src="<%=path %>/servlet/createimage" onclick="this.src+='?'+Math.floor(Math.random()*10);" alt="点击刷新" />点图<a href ="javascript:refrash()">刷新</a></td>
			 <td>${errcode }</td>
			 </tr>
			 </table>
			
			</td>
			<td></td>
		</tr>
		 
		<tr>
			<td>&nbsp;</td>
			<td><br /><input type="submit" value="加上去"  class="addit"  id="tijiao"   /> </td>
			<td></td>
		</tr>
	</table>
        </form>
</div>
</div>

  <%@ include file="../../../../common/footer.jsp" %>
</body>
</html>
